package cn.kgc.service.impl;

import cn.kgc.dao.LoginDao;
import cn.kgc.dao.impl.LoginImpl;
import cn.kgc.entity.Admin;
import cn.kgc.entity.Student;
import cn.kgc.entity.Teacher;
import cn.kgc.service.LoginService;

public class LoginServiceImpl implements LoginService {
    @Override
    public boolean studentLogin(String name, String password) {
        LoginDao loginDao =new LoginImpl();
        Student student = loginDao.studentLogin(name,password);
        if (student!=null)
            return true;
        else{
            return false;
        }
    }

    @Override
    public boolean teacherLogin(String name, String password) {
        LoginDao loginDao =new LoginImpl();
        Teacher teacher = loginDao.teacherLogin(name,password);
        if(teacher!=null){
            return true;
        }else{
            return false;
        }
    }
    @Override
    public boolean adminLogin(String name, String password) {
        LoginDao adminDao=new LoginImpl();
        Admin admin = adminDao.adminLogin(name,password);
        if (admin!=null){
            return true;
        }else{
            return false;
        }
    }
}
